﻿using Prism.Events;
using Sigma.Admin.Client.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Sigma.Admin.Client.Views
{
    /// <summary>
    /// UsersView.xaml 的交互逻辑
    /// </summary>
    public partial class UsersView : UserControl
    {
        private readonly IEventAggregator _ea;
        public UsersView(IEventAggregator ea)
        {
            InitializeComponent();
            _ea = ea;
        }

        private void Flipper_OnIsFlippedChanged(object sender, RoutedPropertyChangedEventArgs<bool> e)
        {
            //newvalue是true就是按下表面（修改）
            if (e.NewValue)
            {
                _ea.SendMessage("Edit", "UserVM");
            }
            else
            {
                _ea.SendMessage("Cancel", "UserVM");
            }
        }
    }
}
